 $LOAD_PATH.unshift File.join(File.dirname(__FILE__),'../..','ext_pr1/lib')
 require 'ext_pr1_v4'

# Minimumauswertung
# min_int ::= (int1, int2):: Nat x Nat -> Nat 
# 
# Test { (1,2) = 1, (2,1) = 1, (2,2) = Err, (2.0,1) = Err, (1,2.0) = Err

def min_int(int1,int2)
  check_pre((int1.nat? and int2.nat? and int1 != int2))
  int1 < int2 ? int1 : int2
end

# Maximumauswertung
# max_int ::= (int1, int2):: Nat x Nat -> Nat where (int1 > int2 or int1 < int2)
# 
# Test { (1,2) = 2, (2,1) = 2, (2,2) = Err, (2.0,1) = Err, (1,2.0) = Err

def max_int(int1,int2)
  check_pre((int1.nat? and int2.nat? and int1 != int2))
  int1 < int2 ? int2 : int1
end

